/**************************************************************************
** Yabet is bloging editor tool that supports many blog's formats. It is very usefull for crossposting, allows easily to
** make posts to your blogs.
**
** Copyright (C) 2010 Valery Konchin <eeexception@gmail.com>
**
** This program is free software: you can redistribute it and/or modify
**     it under the terms of the GNU General Public License as published by
**     the Free Software Foundation, either version 3 of the License, or
**     (at your option) any later version.
**
**     This program is distributed in the hope that it will be useful,
**     but WITHOUT ANY WARRANTY; without even the implied warranty of
**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
**     GNU General Public License for more details.
**
**     You should have received a copy of the GNU General Public License
**     along with this program.  If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

#include "googletranslatedialog.h"
#include "ui_googletranslatedialog.h"

GoogleTranslateDialog::GoogleTranslateDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::GoogleTranslateDialog)
{
    ui->setupUi(this);
}

GoogleTranslateDialog::~GoogleTranslateDialog()
{
    delete ui;
}

void GoogleTranslateDialog::setFromLanguages(QStringList fromLanguages) {
    ui->fromLangComboBox->addItems(fromLanguages);
}

void GoogleTranslateDialog::setToLanguages(QStringList toLanguages) {
    ui->toLangComboBox->addItems(toLanguages);
}

QString GoogleTranslateDialog::getFromLanguage() {
    return ui->fromLangComboBox->currentText();
}

QString GoogleTranslateDialog::getToLanguage() {
    return ui->toLangComboBox->currentText();
}

void GoogleTranslateDialog::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
